home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / GLX / DBglxwidget / GlxDraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  6.0 KB  |  184 lines

  1. /*
  2.  *    These files are for informational purposes and can demonstrate how
  3.  *   to write your own mixed-mode GL-based widgets.  However SGI does not
  4.  *   guarantee that this source code absolutely matches the GLxDraw
  5.  *   widget that is shipped as part of the system.
  6.  */
  7.  
  8. /***********************************************************
  9. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  10. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  11.  
  12.                         All Rights Reserved
  13.  
  14. Permission to use, copy, modify, and distribute this software and its 
  15. documentation for any purpose and without fee is hereby granted, 
  16. provided that the above copyright notice appear in all copies and that
  17. both that copyright notice and this permission notice appear in 
  18. supporting documentation, and that the names of Digital or MIT not be
  19. used in advertising or publicity pertaining to distribution of the
  20. software without specific, written prior permission.  
  21.  
  22. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  23. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  24. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  25. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  26. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  27. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  28. SOFTWARE.
  29.  
  30. ******************************************************************/
  31.  
  32. #ifndef _GlxDraw_h
  33. #define _GlxDraw_h
  34.  
  35. #include <gl/glws.h>
  36.  
  37. /****************************************************************
  38.  *
  39.  * GlxDraw widgets
  40.  *
  41.  ****************************************************************/
  42.  
  43. /* Resources:
  44.  
  45.  Name             Class        RepType        Default Value
  46.  ----             -----        -------        -------------
  47.  destroyCallback     Callback        Pointer        NULL
  48.  exposeCallback      Callback        Pointer        NULL
  49.  ginitCallback       Callback        Pointer        NULL
  50.  inputCallback       Callback        Pointer        NULL
  51.  resizeCallback      Callback        Pointer        NULL
  52.  
  53.  overlayExposeCallback Callback        Pointer        NULL
  54.  underlayExposeCallback Callback    Pointer        NULL
  55.  popupExposeCallback Callback        Pointer        NULL
  56.  
  57.  glxConfig         GlxConfig        GLXconfig *    {{0,0,0}}
  58.  visual             Visual        Visual        NULL
  59.  overrideColormap    OverrideColormap    Boolean        TRUE
  60.  useOverlay         UseOverlay        Boolean        FALSE
  61.  overlayColormap     Colormap        Colormap    NULL
  62.  overlayDepth        Depth        int        0
  63.  overlayVisual       Visual        VisualInfo    NULL
  64.  overlayWindow       Window        Window        0
  65.  useUnderlay         UseUnderlay    Boolean        FALSE
  66.  underlayColormap    Colormap        Colormap    NULL
  67.  underlayDepth         Depth        int        0
  68.  underlayVisual         Visual        VisualInfo    NULL
  69.  underlayWindow         Window        Window        0
  70.  usePopup         UsePopup        Boolean        FALSE
  71.  popupColormap       Colormap        Colormap    NULL
  72.  popupDepth          Depth        int        0
  73.  popupVisual         Visual        VisualInfo    NULL
  74.  popupWindow         Window        Window        0
  75.  
  76.  provideSingleBuffer ProvideSingleBuffer Boolean    FALSE
  77.  singleBuffer         SingleBuffer    Boolean        ?
  78.  altColormap         Colormap        Colormap    NULL
  79.  mainWindow         Window        Window        0
  80. */
  81.  
  82. #define GlxNglxConfig        "glxConfig"
  83. #define GlxCGlxConfig        "GlxConfig"
  84. #define GlxRGlxConfig        "GlxConfig"
  85. #define GlxNvisual        "visual"
  86. #define GlxCVisual        "Visual"
  87. #define GlxRVisualInfo        "VisualInfo"
  88. #define GlxNoverrideColormap    "overrideColormap"
  89. #define GlxCOverrideColormap    "OverrideColormap"
  90.  
  91. #define GlxCCallback         "Callback"
  92. #define GlxNexposeCallback     "exposeCallback"
  93. #define GlxNginitCallback     "ginitCallback"
  94. #define GlxNresizeCallback     "resizeCallback"
  95. #define GlxNinputCallback     "inputCallback"
  96.  
  97. #define GlxCColormap        "Colormap"
  98. #define GlxCDepth        "Depth"
  99. #define GlxCWindow        "Window"
  100.  
  101. #define GlxNuseOverlay        "useOverlay"
  102. #define GlxCUseOverlay        "UseOverlay"
  103. #define GlxNoverlayColormap    "overlayColormap"
  104. #define GlxNoverlayDepth    "overlayDepth"
  105. #define GlxNoverlayVisual    "overlayVisual"
  106. #define GlxNoverlayWindow    "overlayWindow"
  107. #define GlxNoverlayExposeCallback    "overlayExposeCallback"
  108. #define GlxNuseUnderlay        "useUnderlay"
  109. #define GlxCUseUnderlay        "UseUnderlay"
  110. #define GlxNunderlayColormap    "underlayColormap"
  111. #define GlxNunderlayDepth    "underlayDepth"
  112. #define GlxNunderlayVisual    "underlayVisual"
  113. #define GlxNunderlayWindow    "underlayWindow"
  114. #define GlxNunderlayExposeCallback    "underlayExposeCallback"
  115. #define GlxNusePopup        "usePopup"
  116. #define GlxCUsePopup        "UsePopup"
  117. #define GlxNpopupColormap    "popupColormap"
  118. #define GlxNpopupDepth        "popupDepth"
  119. #define GlxNpopupVisual        "popupVisual"
  120. #define GlxNpopupWindow        "popupWindow"
  121. #define GlxNpopupExposeCallback    "popupExposeCallback"
  122.  
  123. #define GlxNprovideSingleBuffer    "provideSingleBuffer"
  124. #define GlxCProvideSingleBuffer    "ProvideSingleBuffer"
  125. #define GlxNsingleBuffer    "singleBuffer"
  126. #define GlxCSingleBuffer    "SingleBuffer"
  127. #define GlxNaltColormap        "altColormap"
  128. #define GlxNmainWindow        "mainWindow"
  129.  
  130. #ifdef __GLX_MOTIF
  131. typedef struct _GlxMDrawClassRec    *GlxMDrawWidgetClass;
  132. typedef struct _GlxMDrawRec        *GlxMDrawWidget;
  133.  
  134. extern WidgetClass glxMDrawWidgetClass;
  135. #else /* not __GLX_MOTIF */
  136. typedef struct _GlxDrawClassRec        *GlxDrawWidgetClass;
  137. typedef struct _GlxDrawRec        *GlxDrawWidget;
  138.  
  139. extern WidgetClass glxDrawWidgetClass;
  140. #endif
  141.  
  142. /* Callback reasons */
  143. #ifdef __GLX_MOTIF
  144. #define GlxCR_EXPOSE    XmCR_EXPOSE
  145. #define GlxCR_RESIZE    XmCR_RESIZE
  146. #define GlxCR_INPUT    XmCR_INPUT
  147. #else /* not __GLX_MOTIF */
  148. /* The same values as Motif, but don't use Motif constants */
  149. #define GlxCR_EXPOSE    38
  150. #define GlxCR_RESIZE    39
  151. #define GlxCR_INPUT    40
  152. #endif /* __GLX_MOTIF */
  153.  
  154. #define GlxCR_GINIT    32135    /* Arbitrary number that should neverr clash*/
  155.  
  156. typedef struct
  157. {
  158.     int     reason;
  159.     XEvent  *event;
  160.     Window  window;
  161.     int     buffer;
  162.     Dimension width, height;        /* for resize callback */
  163. } GlxDrawCallbackStruct;
  164.  
  165.  
  166. #ifdef __GLX_MOTIF
  167. #ifdef _NO_PROTO
  168. extern Widget GlxCreateMDraw ();
  169. #else /* _NO_PROTO */
  170.  
  171. #if defined(__cplusplus) || defined(c_plusplus)
  172. extern "C" {
  173. #endif
  174.  
  175. extern Widget GlxCreateMDraw (Widget parent, char *name, ArgList arglist, Cardinal argcount);
  176. #endif /* _NO_PROTO */
  177.  
  178. #if defined(__cplusplus) || defined(c_plusplus)
  179. }
  180. #endif
  181. #endif /* __GLX_MOTIF */
  182.  
  183. #endif /* _GlxDraw_h */
  184.